package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaDeductProgramMapper;
import com.yiyahui.project.erp.domain.YiyaDeductProgram;
import com.yiyahui.project.erp.service.IYiyaDeductProgramService;

/**
 * 划扣方案Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-12
 */
@Service
public class YiyaDeductProgramServiceImpl implements IYiyaDeductProgramService 
{
    @Autowired
    private YiyaDeductProgramMapper yiyaDeductProgramMapper;

    /**
     * 查询划扣方案
     * 
     * @param id 划扣方案ID
     * @return 划扣方案
     */
    @Override
    public YiyaDeductProgram selectYiyaDeductProgramById(Long id)
    {
        return yiyaDeductProgramMapper.selectYiyaDeductProgramById(id);
    }

    /**
     * 查询划扣方案列表
     * 
     * @param yiyaDeductProgram 划扣方案
     * @return 划扣方案
     */
    @Override
    public List<YiyaDeductProgram> selectYiyaDeductProgramList(YiyaDeductProgram yiyaDeductProgram)
    {
        return yiyaDeductProgramMapper.selectYiyaDeductProgramList(yiyaDeductProgram);
    }

    /**
     * 新增划扣方案
     * 
     * @param yiyaDeductProgram 划扣方案
     * @return 结果
     */
    @Override
    public int insertYiyaDeductProgram(YiyaDeductProgram yiyaDeductProgram)
    {
        yiyaDeductProgram.setCreateTime(DateUtils.getNowDate());
        return yiyaDeductProgramMapper.insertYiyaDeductProgram(yiyaDeductProgram);
    }

    /**
     * 修改划扣方案
     * 
     * @param yiyaDeductProgram 划扣方案
     * @return 结果
     */
    @Override
    public int updateYiyaDeductProgram(YiyaDeductProgram yiyaDeductProgram)
    {
        yiyaDeductProgram.setUpdateTime(DateUtils.getNowDate());
        return yiyaDeductProgramMapper.updateYiyaDeductProgram(yiyaDeductProgram);
    }

    /**
     * 批量删除划扣方案
     * 
     * @param ids 需要删除的划扣方案ID
     * @return 结果
     */
    @Override
    public int deleteYiyaDeductProgramByIds(Long[] ids)
    {
        return yiyaDeductProgramMapper.deleteYiyaDeductProgramByIds(ids);
    }

    /**
     * 删除划扣方案信息
     * 
     * @param id 划扣方案ID
     * @return 结果
     */
    @Override
    public int deleteYiyaDeductProgramById(Long id)
    {
        return yiyaDeductProgramMapper.deleteYiyaDeductProgramById(id);
    }
}
